/**
 * Created by Administrator on 2016/6/27 0027.
 */
$(document).ready(function(){
    $(".example").on("click",function(){
        print();

    })
})
function print() {
    html2canvas($("body"), {
        onrendered: function (canvas) {
            canvas.id = "mycanvas";
            var dataUrl = canvas.toDataURL();
            $(".myimg").append("<img src='"+dataUrl+"'/>");
            $(".myimg").css("display","block");
        }
    });
}